﻿using GrainManage.Entities.Account;
using GrainManage.Proxy.Util;
using System.Reflection;

namespace GrainManage.Proxy
{
    public sealed class AccountProxy : GrainManage.Interface.IAccount
    {
        public OutputSignIn SignIn(InputSignIn input)
        {
            var result = WebUtil.ExecuteByPost<OutputSignIn>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputRegister Register(InputRegister input)
        {
            var result = WebUtil.ExecuteByPost<OutputRegister>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputManageAccount ManageAccount(InputManageAccount input)
        {
            var result = WebUtil.ExecuteByPost<OutputManageAccount>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputResetPassword ResetPassword(InputResetPassword input)
        {
            var result = WebUtil.ExecuteByPost<OutputResetPassword>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputChangePassword ChangePassword(InputChangePassword input)
        {
            var result = WebUtil.ExecuteByPost<OutputChangePassword>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputSignOut SignOut(InputSignOut input)
        {
            var result = WebUtil.ExecuteByPost<OutputSignOut>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }


        public OutputGetEncryptKey GetEncryptKey(InputGetEncryptKey input)
        {
            var result = WebUtil.ExecuteByPost<OutputGetEncryptKey>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }
    }
}
